Disk drive implementing data path protection by encoding large host blocks into sub blocks

ABSTRACT

A disk drive is disclosed including a disk having a plurality of data tracks, wherein each data track includes a plurality of data sectors. A head is actuated over the disk for accessing the data sectors. A write command is received from a host, wherein the write command includes a host block and corresponding host block address. The host block is partitioned into a plurality of sub blocks, and a plurality of sub block addresses are generated in response to the host block address, wherein each sub block address corresponds to one of the sub blocks. Error detection code (EDC) data is generated for each sub block in response to the sub block and corresponding sub block address. Each sub block and corresponding EDC data are combined to generate a plurality of partial codewords that are written to the data sectors corresponding to the sub block addresses.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to disk drives for computer systems. More particularly, the present invention relates to a disk drive implementing data path protection by encoding large host blocks into sub blocks.

2. Description of the Prior Art

Disk drives typically employ a number of interacting components that coordinate the transfer of data from a host during write operations, and the transfer of data read from the disk to the host during read operations. FIG. 1 shows an example of a prior art disk drive comprising one or more disks 2 and corresponding heads 3 enclosed in a head disk assembly (HDA) 4. The disk comprises a number of concentric, radially spaced data tracks, wherein each data track comprises a number of data sectors. A voice coil motor (VCM) 6 actuates the heads 3 over the disks 2 to access a target data sector within a target data track during write and read operations. A printed circuit board (PCB) is mounted to the HDA 4, wherein one or more integrated circuits for controlling operation of the disk drive are mounted on the PCB, including a microprocessor (uP) 8 for executing code segments of a control program. The microprocessor 8 typically accesses a fast uP cache 10 (e.g., an SRAM) through a uP cache controller 11 which caches op codes being executed as well as program data.

The code segments of the control program are typically stored on the disk 2 and loaded into an external buffer memory 12 (e.g., an SDRAM) when the disk drive is powered on. As the microprocessor 8 executes the control program, the uP cache controller 11 transfers a burst of corresponding op codes from the external buffer memory 12 into the uP cache 10 for fast access by the microprocessor 8. Since the buffer memory 12 is typically shared with other control components, a buffer controller 14 implements an arbitration algorithm to arbitrate access to the buffer memory 12. Example control components that may share access to the buffer memory 12 include a host interface 16, a disk interface 18, a data cache controller 20, and an ECC controller 22, one or more of which may be integrated with the microprocessor 8 in a system on a chip (SOC), or implemented as separate integrated circuits.

The host interface 16 facilitates data transfer between the disk drive and a host 24 during read and write operations. That is, during write operations the host interface 16 stages the data received from the host 24 in the buffer memory 12 before it is written to the disk 2, and during read operations data read from the disk 2 is staged in the buffer memory 12 before the host interface 16 transfers the read data to the host 24. The disk interface 18 performs the actual interface functions with the HDA 4 in order to write data stored in the buffer memory 12 to the disk 2, and store data into the buffer memory 12 that is read from the disk 2. The data cache controller 20 accesses a data cache area of the buffer memory 12 in order to implement a suitable caching algorithm, and the ECC controller 22 implements a suitable error correction algorithm on data read from the disk 2 and stored in the buffer memory 12.

The microprocessor 8 is typically preempted by a number of interrupts 26 for performing time critical operations in order to maintain optimal performance. For example, a servo controller 28 may generate an interrupt at each servo wedge, signaling the microprocessor 8 that it is time to compute an updated VCM 6 control command for servoing the head 3, or a spindle motor command for controlling the rotational speed of the disk 2. Preempting the microprocessor 8 in order to service the servo interrupts helps maintain optimal performance of the closed-loop servo systems.

The ever increasing complexity of the control program executed by the microprocessor 8 to coordinate the numerous components of the disk drive increases the probability of a programming error resulting in bad data being transferred to the host 24 during read operations. Defects in the integrated storage elements of the buffer memory 12 may also induce errors in the read data transferred to the host 24. To help protect against transferring bad data to the host 24, prior art disk drives have implemented “data path protection” techniques wherein the host block address received during a write operation is used by the host interface 16 to encode error detection code (EDC) data that is appended to the host block written to the disk 2. During a read operation of the host block, check data is generated using the host block address received from the host 24 to verify the integrity of the read data before it is transferred to the host 24. If the check data does not match the EDC data appended to the read host block, the disk drive may return an error to the host 24, or attempt a retry operation.

In prior art disk drives that employ data path protection techniques, each host block is typically mapped to a corresponding data sector. For example, a 512 byte host block may be mapped to a 516 byte data sector, wherein the additional 4 bytes of each data sector store the data path protection EDC data. However, disk drives are now being designed to receive and store host blocks that are significantly larger than the data sectors, for example 4096 byte host blocks. This creates a problem when implementing data path protection that generates EDC data using the host block address, if a large host block must be stored in a number of smaller data sectors.

There is, therefore, a need for a disk drive capable of implementing data path protection when a large host block is stored in a number of smaller data sectors.

SUMMARY OF THE INVENTION

An embodiment of the present invention comprises a disk drive having a disk comprising a plurality of data tracks, wherein each data track comprises a plurality of data sectors. A head is actuated over the disk for accessing the data sectors. A write command is received from a host, wherein the write command comprises a host block and corresponding host block address. The host block is partitioned into a plurality of sub blocks, and a plurality of sub block addresses are generated in response to the host block address, wherein each sub block address corresponds to one of the sub blocks. Error detection code (EDC) data is generated for each sub block in response to the sub block and corresponding sub block address. Each sub block and corresponding EDC data are combined to generate a plurality of partial codewords that are written to the data sectors corresponding to the sub block addresses. A full codeword includes the sub block address, but there is no need to write the sub block address to the disk.

In one embodiment, the EDC data is generated as cyclical redundancy check (CRC) data.

In another embodiment, each sub block address is generated by appending a plurality of bits to the host block address. The plurality of partial codewords are read from the plurality of data sectors corresponding to the sub block addresses, and check data is generated over each sub block within each partial codeword and the corresponding sub block address. An error is detected by comparing the check data to the corresponding EDC data of each partial codeword.

In still another embodiment, the disk drive further comprises a microprocessor operable to execute a control program, and a host interface for receiving the write command from the host and generating the EDC data for each sub block. In one embodiment, the disk drive further comprises a buffer memory, and the host interface stores the partial codewords in the buffer memory. Each partial codeword is then read from the buffer memory, check data is generated over each sub block within each partial codeword and the corresponding sub block address, and an error is detected by comparing the check data to the corresponding EDC data of each partial codeword.

In still another embodiment, a read command is received from the host, wherein the read command comprises the host block address. The plurality of sub block addresses are generated in response to the host block address, and the plurality of partial codewords are read from the plurality of data sectors corresponding to the sub block addresses. Check data is generated over each sub block within each partial codeword and the corresponding sub block address, and an error is detected by comparing the check data to the corresponding EDC data of each partial codeword. In one embodiment, the disk drive further comprises a microprocessor for executing a control program, and a host interface for receiving the read command from the host and generating the check data. In another embodiment, the disk drive further comprises a buffer memory, and a disk interface for generating the check data, detecting the error by comparing the check data to the corresponding EDC data of each partial codeword, and storing each partial codeword in the buffer memory.

Another embodiment of the present invention comprises a method of operating a disk drive, the disk drive having a disk comprising a plurality of data tracks, wherein each data track comprises a plurality of data sectors, and a head actuated over the disk operable to access the data sectors. A write command is received from a host, wherein the write command comprises a host block and corresponding host block address. The host block is partitioned into a plurality of sub blocks, and a plurality of sub block addresses are generated in response to the host block address, wherein each sub block address corresponds to one of the sub blocks. Error detection code (EDC) data is generated for each sub block in response to the sub block and corresponding sub block address. Each sub block and corresponding EDC data are combined to generate a plurality of partial codewords that are written to the data sectors corresponding to the sub block addresses.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows a prior art disk drive comprising various components, including a microprocessor for executing a control program, a host interface for receiving access commands from a host, and a disk interface for implementing the access commands by accessing the disk.

FIG. 2A shows a disk drive according to an embodiment of the present invention comprising a disk, a head actuated over the disk, and control circuitry for implementing data path protection for large host blocks.

FIG. 2B is a flow diagram executed by the control circuitry for receiving a write command from a host, partitioning a large host block into a plurality of sub blocks, generating EDC data for each sub block using a sub block address, combining the sub blocks with the EDC data to form partial codewords, and writing the partial codewords to data sectors corresponding to the sub block addresses.

FIG. 3 illustrates an embodiment of the present invention for executing a write command wherein a host block comprising 4096 bytes is partitioned into eight sub blocks, with corresponding sub block addresses used to generate EDC data for each sub block.

FIG. 4 is a flow diagram executed by the control circuitry for receiving a read command from a host, generating a plurality of sub block addresses from a host block address, reading partial codewords from corresponding data sectors, and detecting data path errors using the appended EDC data.

FIG. 5 illustrates an embodiment of the present invention for executing a read command wherein a plurality of sub block addresses are generated from a host block address, the partial codewords are read from the corresponding data sectors, and the appended EDC data is processed to detect data path errors.

FIG. 6 shows a disk drive according to an embodiment of the present invention comprising a host interface for performing data path checks, a disk interface for performing data path checks, and a buffer memory for staging the partial codewords during write/read operations.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

FIG. 2A shows a disk drive according to an embodiment of the present invention comprising a disk 2 having a plurality of data tracks, wherein each data track comprises a plurality of data sectors. A head 3 is actuated over the disk 2 for accessing the data sectors. The disk drive further comprises control circuitry 30 for executing the flow diagram of FIG. 2B in order to implement data path protection for large host blocks. At step 32 a write command is received from a host 24, wherein the write command comprises a host block and corresponding host block address. At step 34 the host block is partitioned into a plurality of sub blocks, and a plurality of sub block addresses are generated in response to the host block address, wherein each sub block address corresponds to one of the sub blocks. At step 36 error detection code (EDC) data is generated for each sub block in response to the sub block and corresponding sub block address. At step 38 each sub block and corresponding EDC data are combined to generate a plurality of partial codewords that are written to the data sectors corresponding to the sub block addresses. A full codeword includes the sub block address, but there is no need to write the sub block address to the disk.

Any suitable control circuitry 30 may be employed to implement the embodiments of the present invention. In one embodiment, the control circuitry 30 comprises a microprocessor executing instructions, the instructions being operable to cause the microprocessor to perform the steps of FIG. 2B as well as other functions described herein. The instructions may be stored in any computer-readable medium. In one embodiment, they may be stored on a non-volatile semiconductor memory external to the microprocessor, or integrated with the microprocessor in a system on a chip (SOC). In another embodiment, the instructions are stored on the disk 2 and read into a volatile semiconductor memory when the disk drive is powered on. In yet another embodiment, the control circuitry 30 comprises suitable logic circuitry, such as state machine circuitry.

In the embodiment of FIG. 2A, the head 3 is attached to the distal end of an actuator arm, which is rotated about a pivot by a voice coil motor (VCM) 6 in order to position the head 3 radially over the disk 2. A spindle motor (not shown) rotates the disk 2, creating an air bearing between the disk surface and head 3 so that the head is said to “fly” just above the disk surface. The spindle motor, VCM 6, disk 2 and head 3 are enclosed in a head disk assembly (HDA) 4, wherein the control circuitry 30 is mounted on a printed circuit board coupled to the HDA 4.

FIG. 3 illustrates an embodiment wherein a write command is received from a host, the write command comprising a 4096 byte host block and a host block address of 100. The 4096 byte host block is partitioned into eight 512 byte sub blocks, and eight corresponding sub block addresses are generated in response to the host block address. In the example of FIG. 3, the sub block addresses are generated as fractional addresses 100.0, 100.1, 100.2, 100.3, 100.4, 100.5, 100.6 and 100.7. However, the sub block addresses may be generated in any suitable manner, and in one embodiment, by adding a predetermined number of bits to the host block address. The control circuitry 30 comprises an EDC generator 40 for generating EDC data for each sub block in response to the sub block and corresponding sub block address. In the embodiment of FIG. 3, the EDC data comprises four bytes appended to the 512 byte sub block to form a 516 byte partial codeword written to the data sector corresponding to the sub block address.

Any suitable EDC may be employed in the embodiments of the present invention, such as a cyclical redundancy check (CRC) code. In addition, the EDC generator 40 may comprise any suitable circuitry, and the EDC data may be generated in any suitable manner. In one embodiment, the EDC circuitry comprises a suitable generator polynomial that processes the combined sub block and sub block address, wherein the generator polynomial is seeded with any suitable value. In an alternative embodiment, the generator polynomial is seeded with the sub block address, and the generator polynomial processes the sub block.

In one embodiment, each sub block address corresponds to a logical block address (LBA), which is mapped to an absolute block address (ABA) representing one of the data sectors. The LBA to ABA mapping facilitates the mapping of defective data sectors to spare data sectors. Any suitable algorithm may be employed to implement the LBA to ABA mapping.

FIG. 4 is a flow diagram according to an embodiment of the present invention for reading a large host block in response to a read command by reading the corresponding partial codewords from the data sectors and performing data path protection. At step 42 a read command is received from the host 24, wherein the read command comprises a host block address. At step 44 a plurality of sub block addresses are generated from the host block address, and at step 46 the plurality of partial codewords are read from the plurality of data sectors corresponding to the sub block addresses. At step 48 check data is generated over each sub block within each partial codeword and the corresponding sub block address, and if at step 50 an error is detected by comparing the check data to the corresponding EDC data of each partial codeword, then at step 52 an error is returned to the host 24 (or the read operation may be retried).

FIG. 5 illustrates an embodiment wherein the control circuitry 30 processes a read command received from a host for reading a 4096 byte host block. In this embodiment, the host block address is 100, and the sub block addresses generated from the host block address are 100.0, 100.1, 100.2, 100.3, 100.4, 100.5, 100.6 and 100.7, similar to the sub block addresses generated during the write command illustrated in FIG. 3. The EDC generator 40 processes each sub block address and corresponding sub block within each partial codeword to generate the check data which is compared at step 50 to the EDC data appended to each partial codeword to detect an error. The EDC generator 40 generates the check data in the same manner that it generates the EDC data appended to the sub block during the write operation, for example, using a generator polynomial. If an error is not detected at step 50, then the 512 byte sub blocks are extracted from the 516 byte partial codewords and combined to form the 4096 byte block returned to the host.

FIG. 6 shows a disk drive according to an embodiment of the present invention wherein the control circuitry 30 comprises a microprocessor 8, uP cache controller 11, uP cache 10, ECC controller 22, data cache controller 20, and servo controller 28 similar to the prior art disk drive shown in FIG. 1. The disk drive of FIG. 6 further comprises a buffer memory 12 and a buffer controller 14 for controlling access to the buffer memory by the various components, including a host interface 54 and a disk interface 56. In one embodiment, the host interface 54 receives the write commands from the host 24 and generates the EDC data for each sub block using an EDC generator 40A. The host interface 54 then stores the resulting partial codewords in the buffer memory 12 for staging before being written to the disk 2. When enabled, the disk interface 56 reads each partial codeword from the buffer memory 12 and generates the check data using an EDC generator 40B. If the check data does not match the EDC data appended to the partial codeword, an error is detected. Otherwise, the disk interface 56 writes the partial codeword to the appropriate data sector identified by the sub block address.

During a read command, the disk interface 56 reads a partial codeword from the data sector identified by the sub block address and again generates the check data using the EDC generator 40B. If the check data does not match the EDC data appended to the partial codeword, an error is generated. Otherwise, the disk interface 56 stores the partial codeword in the buffer memory 12 for staging before being transferred to the host 24. When enabled, the host interface 54 reads each partial codeword from the buffer memory 12 and generates the check data using the EDC generator 40A. If the check data does not match the EDC data appended to the partial codeword, an error is detected. Otherwise, the host interface 54 combines and transfers the sub blocks to the host 24.

In one embodiment, the full codeword (sub block address plus partial codeword) is stored in the buffer memory 12 during read and write operations. In this manner, the control circuitry (host interface 54 and disk interface 56) need only access the buffer memory 12 to generate the check data used to verify each codeword. In an alternative embodiment, the sub block address is stored in a different memory, such as the uP cache 10, as part of a data structure associated with each read/write command.

In one embodiment, the host interface 54, disk interface 56, and EDC generators 40A and 40B are implemented as separate components operating under the control of the microprocessor 8. In an alternative embodiment, the microprocessor 8 executes a control program for implementing the functions of the host interface 54, disk interface 56, and/or EDC generators 40A and 40B. 

1. A disk drive comprising: (a) a disk comprising a plurality of data tracks, wherein each data track comprises a plurality of data sectors; (b) a head actuated over the disk operable to access the data sectors; and (c) control circuitry operable to: receive a write command from a host, wherein the write command comprises a host block and corresponding host block address; partition the host block into a plurality of sub blocks; generate a plurality of sub block addresses in response to the host block address, wherein each sub block address corresponds to one of the sub blocks; generate error detection code (EDC) data for each sub block in response to the sub block and corresponding sub block address; combine each sub block and corresponding EDC data to generate a plurality of partial codewords; and write the partial codewords to the data sectors corresponding to the sub block addresses.
 2. The disk drive as recited in claim 1, wherein the EDC data is generated as cyclical redundancy check (CRC) data.
 3. The disk drive as recited in claim 1, wherein each sub block address is generated by appending a plurality of bits to the host block address.
 4. The disk drive as recited in claim 1, wherein the control circuitry comprises: a microprocessor operable to execute a control program; and a host interface operable to receive the write command from the host and generate the EDC data for each sub block.
 5. The disk drive as recited in claim 4, wherein: the control circuitry further comprises a buffer memory; the host interface is further operable to store the partial codewords in the buffer memory; and the control circuitry further comprises a disk interface operable to: read each partial codeword from the buffer memory; generate check data over each sub block within each partial codeword and the corresponding sub block address; and detect an error by comparing the check data to the corresponding EDC data of each partial codeword.
 6. The disk drive as recited in claim 1, wherein the control circuitry is further operable to: receive a read command from the host, wherein the read command comprises the host block address; generate the plurality of sub block addresses in response to the host block address; read the plurality of partial codewords from the plurality of data sectors corresponding to the sub block addresses; generate check data over each sub block within each partial codeword and the corresponding sub block address; and detect an error by comparing the check data to the corresponding EDC data of each partial codeword.
 7. The disk drive as recited in claim 6, wherein the control circuitry comprises: a microprocessor operable to execute a control program; and a host interface operable to receive the read command from the host and generate the check data.
 8. The disk drive as recited in claim 6, wherein: the control circuitry further comprises a buffer memory; and the control circuitry further comprises a disk interface operable to: generate the check data; detect the error by comparing the check data to the corresponding EDC data of each partial codeword; and store each partial codeword in the buffer memory.
 9. A method of operating a disk drive, the disk drive comprising a disk comprising a plurality of data tracks, wherein each data track comprises a plurality of data sectors, and a head actuated over the disk operable to access the data sectors, the method comprising the steps of: receiving a write command from a host, wherein the write command comprises a host block and corresponding host block address; partitioning the host block into a plurality of sub blocks; generating a plurality of sub block addresses in response to the host block address, wherein each sub block address corresponds to one of the sub blocks; generating error detection code (EDC) data for each sub block in response to the sub block and corresponding sub block address; combining each sub block and corresponding EDC data to generate a plurality of partial codewords; and writing the partial codewords to the data sectors corresponding to the sub block addresses.
 10. The method as recited in claim 9, wherein the EDC data is generated as cyclical redundancy check (CRC) data.
 11. The method as recited in claim 9, wherein each sub block address is generated by appending a plurality of bits to the host block address.
 12. The method as recited in claim 9, wherein the disk drive further comprises a microprocessor operable to execute a control program, and a host interface operable to receive the write command from the host and generate the EDC data for each sub block.
 13. The method as recited in claim 12, wherein the disk drive further comprises a buffer memory, the method further comprising the steps of: storing the partial codewords in the buffer memory; reading each partial codeword from the buffer memory; generating check data over each sub block within each partial codeword and the corresponding sub block address; and detecting an error by comparing the check data to the corresponding EDC data of each partial codeword.
 14. The method as recited in claim 9, further comprising the steps of: receiving a read command from the host, wherein the read command comprises the host block address; generating the plurality of sub block addresses in response to the host block address; reading the plurality of partial codewords from the plurality of data sectors corresponding to the sub block addresses; generating check data over each sub block within each partial codeword and the corresponding sub block address; and detecting an error by comparing the check data to the corresponding EDC data of each partial codeword.
 15. The method as recited in claim 14, wherein the disk drive further comprises a microprocessor operable to execute a control program, and a host interface operable to receive the read command from the host and generate the check data.
 16. The method as recited in claim 14, wherein the disk drive further comprises a buffer memory, further comprising the step of storing each partial codeword in the buffer memory. 